#include <string>
#include <ostream>
#include <iostream>
using namespace std;
#include "net/socket.h"
using namespace tdl;

tdl::host_addr ha = "192.168.1.9:9527";

void do_client()
{
	try {
		ostringstream oss;
		tdl::udp_socket us = tdl::udp_socket::create();
//		for(int i = 0; i < 100; ++i)
		for(int i = 0; ; ++i)
		{
			oss.str("");
			oss << i;
			string s = oss.str();
			us.sendto(s.c_str(), s.length(), ha);
			usleep(10);
		}
	} catch(socket_ex& e) {
		cerr << "client: " << e.what_hell() << endl;
		return;
	}
}

//////////////////////
int main(int argc, char* argv[])
{
	do_client();

	return 0;
}
